package com.fangyi.yunmusic.controller;

import com.fangyi.yunmusic.service.CollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CollectionController {
    @Autowired
    private CollectionService collectionService;
    @PostMapping("/collection/songlist")
    public Object collectSonglist(String playlistId,String userId){
        collectionService.collectPlaylist(playlistId,userId);
        return "OK";
    }

    @PostMapping("/collection/artist")
    public Object collectArtist(String artistId,String userId){
        collectionService.collectArtist(artistId,userId);
        return "OK";
    }
    @PostMapping("/discollection/songlist")
    public Object discollectionSonglist(String playlistId,String userId){
        collectionService.discollectPlaylist(playlistId,userId);
        return "OK";
    }
    @PostMapping("/discollection/artist")
    public Object discollectionArtist(String artistId,String userId){
        collectionService.discollectArtist(artistId,userId);
        return "OK";
    }
    @GetMapping("/iscollected/songlist")
    public Object isSonglistCollected(String playlistId,String userId){
        return collectionService.isPlaylistCollected(playlistId,userId);
    }
    @GetMapping("/iscollected/artist")
    public Object isArtistCollected(String artistId,String userId){
        return collectionService.isArtistCollected(artistId,userId);
    }

}
